package com.shujia.util

import java.io.InputStream
import java.util.Properties

object Config {

  //读取配置二年间
  val imputStream: InputStream = this.getClass.getClassLoader
    .getResourceAsStream("config.properties")

  private val properties = new Properties()

  properties.load(imputStream)

  def getString(key: String): String = {
    properties.getProperty(key)
  }

  def getBoolean(key: String): Boolean = {
    properties.getProperty(key) match {
      case "false" => false
      case "true" => true
      case _ => false
    }
  }

  def main(args: Array[String]): Unit = {
   println( Config.getBoolean("is.local"))
  }

}
